package com.lcxw.hxzbapi.service;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbapi.dao.mapper.GiftSendMapper;
import com.lcxw.hxzbapi.entity.pojo.GiftSend;

@Component
public class GiftSendService {

    @Resource
    GiftSendMapper giftSendMapper;

    public int insertGiftEarn(GiftSend giftearn)throws Exception {
      return giftSendMapper.insertGiftEarn(giftearn);
    }

    public List<GiftSend> selectByFromUserId(long fromUserId) throws Exception{
        return giftSendMapper.selectByFromUserId(fromUserId);
    }

    public List<GiftSend> selectByUserId(long userId){
        return giftSendMapper.selectByUserId(userId);
    }

    public List<GiftSend> selectByUserIdAndFromUserId(long userId, long fromUserId) throws Exception{
        return giftSendMapper.selectByUserIdIdAndFromUserId(userId,fromUserId);
    }

    public List<GiftSend> selectByRoomId(long roomId){
        return giftSendMapper.selectByRoomId(roomId);
    }

    public List<GiftSend> selectCurrentDayByRoomId(long roomId,String addTime){
        return giftSendMapper.selectCurrentDayByRoomId(roomId,addTime);
    }

    public int updateByRoomId(GiftSend gift) throws Exception{
        return giftSendMapper.updateByRoomId(gift);
    }

    public List<GiftSend> selectAll() throws Exception{
        return giftSendMapper.selectAll();
    }

    public List<GiftSend> selectAfterTime(String time) throws Exception{
        return giftSendMapper.selectAfterTime(time);
    }
}